import axios from "@/utils/request";

//封装用户相关
export const login = data => axios({
    url: '/login',
    method: 'post',
    data
    
})

//封装注册
export const register = data => axios({
    url: '/register',
    method: 'post',
    data
    
})

//个人中心接口 /user/:id get
// export const personal = (id,token) => axios({
export const personal = (id) => axios({
    url: `/user/${id}`,
    method: 'get',
    // headers: {Authorization :token} 
})

//上传文件接口
export const upload = (data) => axios({
    url: '/upload',
    method: 'post',  
    data
})

//修改个人信息接口
export const user_update = (id,data) => axios({
    url: '/user_update/' + id,
    method: 'post',
    data
})

//关注
export const user_follows = id => axios({
    url: '/user_follows/' + id,
    method: 'get',
})

// 取消关注
export const user_unfollow = id => axios({
    url: '/user_unfollow/' + id,
    method: 'get',
})



// 我的关注
export const follow_list = ()=> axios({
    url: '/user_follows/',
    method: 'get',
})
